public class Solution748 {
    public String shortestCompletingWord(String licensePlate, String[] words) {
        licensePlate=licensePlate.toUpperCase();
        int[] re=new int[100];
        for (char ch:licensePlate.toCharArray()){
            re[ch]++;
        }
        String ans=null;
        for (String word : words) {
            String newWord=word.toUpperCase();
            int[] re2=new int[100];
            for (char ch:newWord.toCharArray()){
                re2[ch]++;
            }
            boolean flag=true;
            for (int i='A';i<='Z' && flag;i++){
                if (re2[i]<re[i]){
                    System.out.println((char)i);
                    flag=false;
                }
            }
            if (flag && (ans==null || ans.length()>word.length())){
                ans=word;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution748().shortestCompletingWord("1s3 PSt",new String[]{"step", "steps", "stripe", "stepple"}));
    }
}
